<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.inter.law.readTaskList"%>
<%@page import="com.inter.law.dao.IlTaskDAO" %>
<%@page import ="com.inter.law.entity.IlTask" %>
<%@page import=" java.sql.Timestamp;" %>
<% request.setCharacterEncoding("utf-8") ;%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="css/allpage.css" rel="stylesheet" media="all" />
    <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
  	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
  	<script type="text/javascript">
		$(function(){
    	$("[name='status']:checkbox").each(function(index){
    	$(this).bind("click", function(){
    	//alert($(this).attr("checked"));
    		var number=$("input[name='id']").eq(index).val();
    		var statuss=0;
    		if($(this).attr("checked")=="checked"){
    		statuss=1;
    		}else{
    		statuss=0;
    		}
          $("form[name='form']").attr("action","mission.action?ids="+number+"&statuss="+statuss);
          $("form[name='form']").submit();
    	});
			
    });
});
</script>
  </head>
  <body>
  <form name="form" method="post"  action="mission.action" >
 <table border="1">
   <tr>
    <td>任务状态</td>
        <td>案件ID</td>
   <td>任务名</td>
   <td>任务简介</td>
   <td>创建时间</td>
   <td>截至时间</td>
   </tr>
  
     <%
	readTaskList readTask=new readTaskList();
	List<IlTask> itasks =  readTask.readTaskList();
	for(int i=0; i< itasks.size(); i++){
	%>
         
          <tr>
          		<input type="hidden" name="id" value=<%= itasks.get(i).getId()%>>
          		<%if(itasks.get(i).getStatus().equals(1)){ %>
          		<td><%= itasks.get(i).getId()%><input type="checkbox" name="status" checked="checked" value=<%= itasks.get(i).getStatus()%>></td>
          		<%}else {%>
          		<td><%= itasks.get(i).getId()%><input type="checkbox" name="status" value=<%= itasks.get(i).getStatus()%>></td>
          		<%} %>
          		<td><%= itasks.get(i).getCaseId()%></td>
                <td><%= itasks.get(i).getTaskProfile()%></td>
              <td><%= itasks.get(i).getContent()%></td>
              <td><%= itasks.get(i).getStartDate()%></td>
              <td><%= itasks.get(i).getEndDate()%></td>
          </tr>
          <%
          } %>
       </table>
</form>
</body>
</html>
